<!--
  <%- @tables.each do |table| -%>
  <%= pluralize(table[:name], table[:count]) %><%= ": #{truncate(table[:content].first.message)}" if table[:count] > 0 %>
  <%- end -%>
  <%= pluralize("Markdown", @markdowns.size) %>
-->
<%- @tables.each do |table| -%>
  <%- if table[:content].any? || table[:resolved].any? -%>
<table>
  <thead>
    <tr>
      <th width="50"></th>
      <th width="100%" data-danger-table="true" data-kind="<%= table[:name] %>">
        <%- if table[:count] > 0 -%>
          <%= pluralize(table[:name], table[:count]) %>
        <%- else -%>
          :white_check_mark: <%= random_compliment %>
        <%- end -%>
      </th>
     </tr>
  </thead>
  <tbody>
    <%- max_num_violations = FindMaxNumViolations.new(table[:content]).call -%>
    <%- table[:content].take(max_num_violations).each do |violation| -%>
    <tr>
      <td>:<%= table[:emoji] %>:</td>
      <td data-sticky="<%= violation.sticky %>"><%= violation.message %></td>
    </tr>
    <%- end -%>
    <%- if table[:content].length > max_num_violations -%>
      <tr>
        <td>:warning:</td>
        <td>
        Danger found <%= table[:content].length %> violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to <%= max_num_violations %>.
        </td>
      </tr>
    <%- end -%>
    <%- table[:resolved].each do |message| -%>
      <tr>
        <td>:white_check_mark:</td>
        <td data-sticky="true"><del><%= message %></del></td>
      </tr>
    <%- end -%>
  </tbody>
</table>
  <%- end -%>
<%- end -%>

<%- @markdowns.each do |current| -%>
<%= current %>
<%# the previous line has to be aligned far to the left, otherwise markdown can break easily %>
<%- end -%>
<p align="right" data-meta="generated_by_<%= @danger_id %>">
  Generated by :no_entry_sign: <a href="https://danger.systems/">Danger</a>
</p>
